//
//  SocketRocketUtility.h
//
//

#import <Foundation/Foundation.h>
#import "SocketRocket.h"

extern NSString * const kNeedPayOrderNote;
extern NSString * const kWebSocketDidOpenNote;
extern NSString * const kWebSocketDidCloseNote;
extern NSString * const kWebSocketdidReceiveMessageNote;

@interface SocketRocketUtility : NSObject

// 获取连接状态
@property (nonatomic,assign,readonly) SRReadyState socketReadyState;

+ (SocketRocketUtility *)instance;

///连接结果回调
@property (nonatomic,copy) void(^socketStateChange)(SRReadyState socketReadyState);

///接到消息的回调
@property (nonatomic,copy) void(^scoketMessageBlock)(NSDictionary *messageDic);

-(void)SRWebSocketOpenWithURLString:(NSString *)urlString;//开启连接
-(void)SRWebSocketClose;//关闭连接

@end
